import wordcloud
import numpy
from PIL import Image
wctype=numpy.array(Image.open("第3次作业-词云-原始图片.jpg"))
wdcd=wordcloud.WordCloud(background_color='white',font_path='simsun.ttc',mask=wctype)
wdcd.generate(open('第3次作业-词云-原始文本.txt','r',encoding='utf-8').read())
wdcd.to_file("第3次作业-词云-结果图片.jpg")
